package com.pro.service.imple;

import com.pro.mapper.JsRoleAuthorityMapper;
import com.pro.pojo.JsRoleAuthority;
import com.pro.pojo.JsUser;
import com.pro.pojo.JsonData;
import com.pro.service.JsRoleAuthorityService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author 祖铭泽
 * @Date 2022/2/22/0022
 * @description 用户权限 业务层 实现类
 */
@Service
public class JsRoleAuthorityServiceImple implements JsRoleAuthorityService {
    @Autowired
    private JsRoleAuthorityMapper jsRoleAuthorityMapper;
    /**
     * @Author 祖铭泽
     * @Date 2022/2/22/0022
     * @description 添加用户权限
     */
    @Override
    public JsonData addUserAuthoritys(JsRoleAuthority jsRoleAuthority) {
        boolean addUserAuthoritys = jsRoleAuthorityMapper.addUserAuthoritys(jsRoleAuthority);
        return addUserAuthoritys ? JsonData.buildSuccess(true) : JsonData.buildError("添加失败");
    }
    /**
     * @Author 祖铭泽
     * @Date 2022/2/22/0022
     * @description 添加多个用户权限
     */
    @Override
    public boolean addUsersAuthoritys(List<JsUser> jsUsers) {
        return jsRoleAuthorityMapper.addUsersAuthoritys(jsUsers);
    }
}
